package vue;

import modele.*;

import javax.swing.*;

import java.awt.*;
import java.io.*;
import java.util.Vector;

public class ArbreDecision
{
	public static Attribute_Data attribute_Data = new Attribute_Data();
	//public static CliqueAbstraite clique;
	public static DownloadFile dfile = new DownloadFile("Votre fichier correspondant au jeu de donnée", "weather.nominal.arff");
	//public static Choix_clique cliques = new Choix_clique();
	//public static Choix_representation representations = new Choix_representation();
	public static JProgressBar progressBar = new JProgressBar(0,5000);

	public static Attribute_Data getAttribute_Data() {
		return attribute_Data;
	}

	public static void setAttribute_Data(Attribute_Data attribute_Data) {
		ArbreDecision.attribute_Data = attribute_Data;
	}

	/*
	public static CliqueAbstraite getClique()
	{
		return clique;
	}*/

	/*
	public static void setClique(CliqueAbstraite clique)
	{
		GrapheClique.clique = clique;
	}*/

	
	public static void loadFichier()
	{
		attribute_Data = new Attribute_Data(dfile.getPathText());
	}

	public static void lancerAffichage() throws IOException
	{
		JFrame cadre = new javax.swing.JFrame("Arbre Decision");

		AfficheArbreDecision atree = new AfficheArbreDecision();
		RechercheArbreDecision rtree = new RechercheArbreDecision();
		Ecran_fenetre ecran = new Ecran_fenetre(atree);
		Affichage.setECRAN(ecran);

		JPanel top = new JPanel();
		top.setLayout(new BorderLayout());
		top.add(dfile, BorderLayout.NORTH);
		top.add(progressBar, BorderLayout.CENTER);

		JPanel panneau = new JPanel();
		panneau.setLayout(new BorderLayout());
		panneau.add(top, BorderLayout.NORTH);
		panneau.add(atree, BorderLayout.CENTER);
		panneau.add(rtree, BorderLayout.SOUTH);

		cadre.setContentPane(panneau);
		cadre.pack();
		cadre.setLocationRelativeTo(null);
		cadre.setVisible(true);
		cadre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}

	public static void main(String[] arg) throws IOException
	{
		ArbreDecision.lancerAffichage();
	}
}

